package com.zzyl.mapper;

import com.github.pagehelper.Page;
import com.zzyl.entity.AlertData;
import com.zzyl.entity.AlertRule;
import com.zzyl.vo.AlertRuleVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.ArrayList;
import java.util.List;

@Mapper
public interface AlertRuleMapper {

    void insert(AlertRule alertRule);

    Page<AlertRuleVo> getPage(String alertRuleName, String functionName, String productKey);

    void updateAlertRule(AlertRule alertRule);

    void deleteAlertRule(Long id);

    List<AlertRuleVo> getAlertRule(String iotId, String functionId, String productKey);

    @Select("select sur.user_id from sys_user_role sur left join sys_role sr on sur.role_id = sr.id where sr.role_name = #{deviceMaintainerRole}")
    List<Long> queryDeviceRepair(String deviceMaintainerRole);

    List<Long> queryDeviceElder(String iotId);

    List<Long> queryDeviceElderAndBed(String iotId);

    void batchInsert(List<AlertData> list);
}














